package com.shouhe.mysap.controller;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * @author 守鹤
 * @date 2020/5/31 21:37
 */
@Controller
public class PageController {

    @RequestMapping("/{url}")
    public String showPage(@PathVariable String url){
        Logger logger = LoggerFactory.getLogger(PageController.class);
        logger.info("访问http://localhost:9999/go/"+url+"页面");
        System.out.println("访问http://localhost:9999/"+url+"页面");
        return url;
    }


    @RequestMapping("/system/{url}")
    public String showSystemPage(@PathVariable String url){
        Logger logger = LoggerFactory.getLogger(PageController.class);
        logger.info("访问http://localhost:9999/go/"+url+"页面");
        System.out.println("访问http://localhost:9999/system/"+url+"页面");
        return "system/"+url;
    }

    @RequestMapping("/sale/{url}")
    public String showSalePage(@PathVariable String url){
        Logger logger = LoggerFactory.getLogger(PageController.class);
        logger.info("访问http://localhost:9999/go/"+url+"页面");
        System.out.println("访问http://localhost:9999/sale/"+url+"页面");
        return "sale/"+url;
    }


    @RequestMapping("/tech/{url}")
    public String showTechPage(@PathVariable String url){
        Logger logger = LoggerFactory.getLogger(PageController.class);
        logger.info("访问http://localhost:9999/go/"+url+"页面");
        System.out.println("访问http://localhost:9999/tech/"+url+"页面");
        return "tech/"+url;
    }

    @RequestMapping("/plan/{url}")
    public String showPlanPage(@PathVariable String url){
        Logger logger = LoggerFactory.getLogger(PageController.class);
        logger.info("访问http://localhost:9999/go/"+url+"页面");
        System.out.println("访问http://localhost:9999/plan/"+url+"页面");
        return "plan/"+url;
    }
    @RequestMapping("/pur/{url}")
    public String showPurPage(@PathVariable String url){
        Logger logger = LoggerFactory.getLogger(PageController.class);
        logger.info("访问http://localhost:9999/go/"+url+"页面");
        System.out.println("访问http://localhost:9999/pur/"+url+"页面");
        return "pur/"+url;
    }


    @RequestMapping("/finance/{url}")
    public String showFinancePage(@PathVariable String url){
        Logger logger = LoggerFactory.getLogger(PageController.class);
        logger.info("访问http://localhost:9999/go/"+url+"页面");
        System.out.println("访问http://localhost:9999/finance/"+url+"页面");
        return "finance/"+url;
    }
}
